package com.macro.mall.common.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * WebMvc配置类
 * @author macro
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    
    @Autowired
    private TraceIdResponseInterceptor traceIdResponseInterceptor;
    
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 注册traceId响应拦截器
        registry.addInterceptor(traceIdResponseInterceptor)
                .addPathPatterns("/**");
    }
}